#include<bits/stdc++.h>
using namespace std;

int main()
{
    list<int> myList = {1,2,3,4,5,6,7,8,9,10};
    deque<int> myEven;
    deque<int> myOdd;

    for(int num:myList)
    {
        if(num%2==0)
        {
            myEven.push_back(num);
        }
        else
        {
            myOdd.push_back(num);
        }
    }

    for(int num:myEven)
    cout<<num<<" ";
    cout<<"\n";
    for(int num:myOdd)
    cout<<num<<" ";
    cout<<"\n";    

    return 0;
}